#ifndef dq_Alchemy_h
#define dq_Alchemy_h

#include "Record.h"
#include <utility/EventHandler.h>

namespace serika
{
	namespace db
	{
		class Alchemy;
	}

	namespace dq
	{
		class Item;

		class Alchemy : public ut::EventHandler
		{
			typedef Record<db::Alchemy> Db;

			Alchemy(db::Alchemy* alchemy, TransientState::Enum state);
		public:
			~Alchemy();

			static Alchemy* FromDb(db::Alchemy* alchemy);

			int Product() const;
			int Material1() const;
			int Num1() const;
			int Material2() const;
			int Num2() const;
			int Material3() const;
			int Num3() const;

			Item* ProductItem();
			Item* Material1Item();
			Item* Material2Item();
			Item* Material3Item();

			void Save() {}
			void Delete() {}

			virtual void Handle(const ut::Event& e);

		private:
			Db* mDb;

			Item* mProduct;
			Item* mMaterial1;
			Item* mMaterial2;
			Item* mMaterial3;

			void SendEvent(int id, int code);
		};
	}
}

#endif
